package com.example.pmanagesys.mapper;

import com.example.pmanagesys.entity.Log;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface LogMapper {
    // 新增数据
    @Insert("insert into sys_log(operator, logType, recordTime, operatorIP, requestType, RequestInterface, requestParameters,responseType,resdata,error)" +
            "VALUES(#{operator}, #{logType}, #{recordTime}, #{operatorIP}, #{requestType}, #{requestInterface}, #{requestParameters},#{responseType},#{resdata},#{error})" )
    int save(Log log);

    // 查询某一页的数据 ，分页
    List<Log> selectPage(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize,
                         @Param("operator") String operator,
                         @Param("logType") String logType,
                         @Param("requestInterface") String requestInterface);
    // 查询总条数
    Integer selectTotal(@Param("operator") String operator,
                        @Param("logType") String logType,
                        @Param("requestInterface") String requestInterface);

}




